import { IParam } from '../../common';
import { IEvent } from '../../modules';
import { IPanelAbility } from '../ability';
import { ICtrlActionResult } from '../data-action';
import { IPanelStore } from '../store';
import { IDECtrlController } from './i-de-ctrl-controller';

/**
 * 面板部件控制器接口
 *
 * @export
 * @interface IPanelController
 * @extends {ICtrlController}
 */
export interface IPanelController<
	S extends IPanelStore,
	A extends IPanelAbility
> extends IDECtrlController<S, A> {
	/**
	 * 面板数据加载
	 *
	 * @param {IParam} [opts]
	 * @return {*}  {Promise<void>}
	 * @memberof IPanelController
	 */
	load(opts?: IParam): Promise<ICtrlActionResult>;

	/**
	 * 处理组件行为
	 *
	 * @param {IEvent<string>} actionParam 行为参数
	 * @memberof IPanelController
	 */
	handleComponentAction(actionParam: IEvent<string>): void;
}
